package com.pocket.demo.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pocket.demo.business.dao.RoleMapper;
import com.pocket.demo.business.po.Role;
import com.pocket.demo.business.service.RoleService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhaozhile
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {

    @Override
    public List<Role> listByUserId(Long userId) {
        if (userId == null){
            return new ArrayList<>();
        }
        return baseMapper.listByUserId(userId);
    }

}
